<extend name="Common/base"/>

<block name="body">
    <style>
        body{
            background: #f1f1f1;
        }
        .container{
            background: transparent !important;
        }
        .article_list{
            display: flex;
            justify-content: left;
            flex-wrap: wrap;
            background: initial;
            box-sizing: border-box;
        }
        .list_item{
            box-sizing: border-box;
            width:47%;
            background: #fff;
            margin:1%;
            margin-top: 2%;
            margin-bottom: 0;
            /*box-shadow: 0 2px 2px #c8c8c8;*/
            flex-grow:0;
            padding:0;
        }
        .list_item:nth-child(odd){
            margin-left:2%;
        }
        .list_item:nth-child(even){
            margin-right:2%;
        }
        .list_item:after{
            border:0;
        }
        
        .list_item .cover{
            float: none;
            width: 100%;
            overflow: hidden;
        }
        .list_item .cover .img{
            width:100%;
            height:auto;
        }
        .list_item .cont{
            display: flex;
            /*height: 62px;*/
            align-items: center;
            padding-left: 10px;
            padding-right: 10px;
        }
        .list_item .cont .title{
            font-size:14px;
            text-align: left;
            margin: 6px 0;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            /*display: -webkit-box;*/
            /*-webkit-line-clamp: 2;*/
            /*-webkit-box-orient: vertical;*/
            /*white-space: normal;*/
            /*text-indent: 2em;*/
            color: #424242;
        }
        .list_item .cont .desc{
            padding-bottom: 20px;
            overflow: hidden;
            display: -webkit-box;
            white-space: pre-wrap;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            word-break: break-all;
        }
        .line{
            border-bottom: 1px solid #f1f1f1;
            margin-left: -50px;
            margin-right: -50px;
        }
        .question{
            padding-left: 10px;
            padding-right: 10px;
            color: #989898;
            margin: 6px 0;
            font-size: 12px;
        }
    </style>
    <div class="container">
        <div id="js_plugins_loading" class="loading" style="display: none;">
            加载中    </div>
        <div id="js_plugins" style="visibility: visible;">
    
            <div class="slider js_plugin" id="namespace_0" data-pid="1">
                <div class="swiper-container">
                    <div class="swiper-wrapper">
                
                        <if condition="!I('get.user','')">
                            <article:position type="Record" pos="2" cate="33" limit="6" name="article" key="key">
                                <div class="swiper-slide ">
                                    <a href="{:U('Record/detail',['id'=>$article['id'],'cate'=>$article['category_id']])}">
                                        <img class="img portrait noShow" data-width="10" data-height="6" src="http://{:C('DOMAIN')}{$article.images|get_cover='path'}" style="height: 180px;float: left;">
                                        <h4 class="swiper-title">{$article.content}</h4>
                                    </a>
                                </div>
                            </article:position>
                        </if>
                    </div>
                    <!-- Add Pagination -->
                    <div class="swiper-pagination"></div>
                    <!-- Add Pagination -->
                </div>
        
                <!-- Swiper JS -->
                <script src="__JS__/swiper.min.js"></script>
        
                <!-- Initialize Swiper -->
                <script>
                    var swiper = new Swiper('.swiper-container', {
                        pagination: '.swiper-pagination',
                        paginationClickable: true,
                        nextButton: '.swiper-button-next',
                        prevButton: '.swiper-button-prev',
                        autoHeight: true //enable auto height
                    });
                </script>
            </div>
            <div class="tab js_plugin" id="namespace_1" data-pid="2">
                
                <div class="tab_bd">
                    
                    <div class="article_list article_list_0">
                        
                        <volist name="list" id="info">
                            <!--<a class="list_item js_post" href="{:U('Article/detail',['id'=>$info['id'],'cate'=>$info['category_id']])}" title="{$info.title}">-->
                                <!--<div class="cover">-->
                                    <!--<img class="img js_img noShow" src="http://{:C('DOMAIN')}{$info.cover_id|get_cover='path'}" alt="">-->
                                <!--</div>-->
                                <!--<div class="cont">-->
                                    <!--<h2 class="title js_title">{$info.title}</h2>-->
                                <!--</div>-->
                            <!--</a>-->
                            <a class="list_item js_post" href="{:U('Record/detail',['id'=>$info['id'],'cate'=>$info['category_id']])}" title="{$info.title}">
                                <div class="cover portrait" data-width="100" data-height="80">
                                    <!--<div class="img js_img portrait" data-width="290" data-height="300" style="width: 100%;height:320px;background-image:url(http://{:C('DOMAIN')}{$info.cover_id|get_cover='path'});background-size: cover;" ></div>-->
                                    <img class="img js_img noShow"  src="http://{:C('DOMAIN')}{$info.cover_id|get_cover='path'}" alt="">
                                </div>
                                <div class="cont">
                                    <h2 class="title js_title">{$info.content}</h2>
                                </div>
                                <div class="line"></div>
                                <p class="question">{$info.question.title}</p>
                            </a>
                        </volist>
                    </div>
                    
                    <div class="article_list article_list_1" style="display: none;">
                    
                    </div>
                
                </div>
            </div>
        
            <include file="bottom"/>
        </div>
    </div>
    <script>
        $(function(){
            var $p = 0, $url = "index.php/Record/api", $callback;
            init($p);
            
            function init(){
                var $res, $data;
                // 获取数据
                $res = send_data({action:'getList',page:$p}, $url, $callback);
                
                // 添加元素
                
                //
            }
            
            
            
            
            // 回调函数
            $callback = function($res){
                console.log($res);
                if ( $res.status == 1 ) {
                    // 解析数据，添加元素
                    
                } else {
                    console.log('获取数据失败 '+ $res.msg);
                }
            };
            
            $template = function ($data){
                return $data;
            };
            
            // 添加元素
            function add_element($container, $list, $template){
                for( var $i; $i< $list.length; $i++ ) {
                    $container.append($template($list.eq($i)));
                }
            }
            
            // 请求数据
        });
    </script>

</block>